<?php
	####################################################
	# library import and object instance.              #
	####################################################
	include_once('./common.php');


	####################################################
	# request data($_POST AND $_GET FROM $_REQUEST)    #
	####################################################
	# REQUEST(get and post variables)

	# GET(url variables)

	# POST(form variables)

	# Validation(special case validate)

	####################################################
	# implementation                                   #
	####################################################
	$html->set_title("nScaffold");
	$html->set_script("{$JS}jquery.1.7.1.min.js");
	$html->custom_js("{$JS}lib.control.js");
	$html->set_style("{$CSS}basic.css");
	$html->html_header();

	#make directory for download
	IoFileAndDir::rmdir_and_unlink('temp', TRUE);
	@mkdir('temp', 0755);

#query
$query = <<<E
CREATE TABLE `fruits_test1` (
  `fuid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'pk',
  `name` varchar(255) NOT NULL COMMENT '과일이름',
  `name_eng` varchar(255) NOT NULL COMMENT '과일이름(영문)',
  `enable` enum('Y','N') NOT NULL DEFAULT 'Y' COMMENT '확인',
  `description` text NOT NULL COMMENT '설명',
  PRIMARY KEY (`fuid`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='과일들';
E;
?>
	<!-- <xmp><?=$query?></xmp> -->
	<?=NForm::open(NULL, FALSE)?>
		<h1>nScaffold</h1>
		<table width="100%" border="1" cellspacing="3" cellpadding="3">
			<colgroup>
				<col width="10%" />
				<col width="90%" />
			</colgroup>
			<tr>
				<th class="header">TYPE</th>
				<th class="header">DATA</th>
			</tr>
			<tr>
				<th colspan="2" class="header">
					<h3>DB</h3>
				</th>
			</tr>
			<tr>
				<th>SQL</th>
				<td><textarea name="sql" id="sql" cols="80" rows="10" class="code"><?=$query?></textarea></td>
			</tr>
			<tr>
				<th>TABLE NAME</th>
				<td><input name="table_name" id="table_name" type="text" value="fruits_test1" /></td>
			</tr>
			<tr>
				<th>PK</th>
				<td><input name="pk_key" id="pk_key" type="text" value="fuid" /></td>
			</tr>
			<tr>
				<th colspan="2" class="header">
					<h3>APP</h3>
				</th>
			</tr>
			<tr>
				<th>APP PREFIX</th>
				<td><input name="app_prefix" id="app_prefix" type="text" value="app_" /></td>
			</tr>
			<tr>
				<th>COMMON</th>
				<td><input name="common_page" id="common_page" type="text" value="common.php" /></td>
			</tr>
			<tr>
				<th>LIST</th>
				<td><input name="list_page" id="list_page" type="text" value="list.php" /></td>
			</tr>
			<tr>
				<th>CREATE</th>
				<td><input name="create_page" id="create_page" type="text" value="create.php" /></td>
			</tr>
			<tr>
				<th>RETRIEVE</th>
				<td><input name="retrieve_page" id="retrieve_page" type="text" value="retrieve.php" /></td>
			</tr>
			<tr>
				<th>UPDATE</th>
				<td><input name="update_page" id="update_page" type="text" value="update.php" /></td>
			</tr>
			<tr>
				<th>DELETE</th>
				<td><input name="delete_page" id="delete_page" type="text" value="delete.php" /></td>
			</tr>
			<tr>
				<th>scaffold_info</th>
				<td><input name="scaffold_info" id="scaffold_info" type="text" value="ayaxyz1425" /></td>
			</tr>
			<tr>
				<td colspan="2" align="right"><input type="submit" value="Make My Pages" class="w200"/></td>
			</tr>
		</table>
	<?=NForm::close()?>
<?php
	$html->html_footer();
?>